﻿using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace XYS.Core.Models
{
    /// <summary>
    /// 数据库对象不存在 异常
    /// </summary>
    public class ExistCheckExpression : Exception
    {
        /// <summary>
        /// 状态码
        /// </summary>
        public EnumStatusCode StatusCode { get; set; }

        /// <summary>
        /// 数据库对象不存在 异常
        /// </summary>
        public ExistCheckExpression()
        {
            this.StatusCode = EnumStatusCode.InternalServerError;
        }

        /// <summary>
        /// 数据库对象不存在 异常
        /// </summary>
        public ExistCheckExpression(string message, EnumStatusCode statusCode = EnumStatusCode.InternalServerError) : base(message)
        {
            this.StatusCode = statusCode;
        }

        /// <summary>
        /// 数据库对象不存在 异常
        /// </summary>
        public ExistCheckExpression(string message, Exception innerException, EnumStatusCode statusCode = EnumStatusCode.InternalServerError) : base(message, innerException)
        {
            this.StatusCode = statusCode;
        }

        /// <summary>
        /// 数据库对象不存在 异常
        /// </summary>
        protected ExistCheckExpression(SerializationInfo info, StreamingContext context, EnumStatusCode statusCode = EnumStatusCode.InternalServerError) : base(info, context)
        {
            this.StatusCode = statusCode;
        }
    }
}
